package com.a;

import java.util.Random;
import java.util.Scanner;

public class range {
    public static void main(String[] args) {

        String[] name=new String[5];
        Scanner us=new Scanner(System.in);

        for(int i=0;i<name.length;i++)
        {
            System.out.println("请输入名字"+(i+1)+":");
            String names=us.next();
            name[i]=names;
        }
        Random r=new Random();
        for(int i=0;i<name.length;i++)
        {
            int index=r.nextInt(name.length);
            String  t=name[index];
            name[index]=name[i];
            name[i]=t;
        }

        for (int i=0;i<name.length;i++) {
            System.out.println(name[i]);
        }

    }
}
